I want to display activity indicator for the initial load time for each collection view cell. So I tried to place it in the table view delegate method cellForItemAtIndexPath: and created 25 pixels above the cell for some reason.
Below is my code:
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { let cell = self.collectionView.dequeueReusableCellWithReuseIdentifier("AACollectionViewCell", forIndexPath: indexPath) as! AACollectionViewCell let activityView = UIActivityIndicatorView (activityIndicatorStyle: .Blue) activityView.center = cell.myImage.center activityView.center = cell.contentView.center activityView.startAnimating() return cell }
Now, Please tell me the proper way to handle the activity indicator or what the wrong in my code..!
Thank you.
Tarun Kumar
25-Apr-2016